<style>
<!--
.reg-input {
	padding: 5px 10px;
	border: 1px solid #DDD;
	border-top: 1px solid #CCC;
	color: #65645A;
	-webkit-border-radius: 5px;
	-moz-border-radius: 5px;
	border-radius: 5px;
	padding-left: 16px;
	width: 430px;
	height: 40px;
	font-size: 20px;
	font-weight: normal;
	margin-right: 110px;
	float: right;
}
.reg-label {
	float: left;
	clear: both;
	font-weight: bold;
	font-size: 14px;
	margin-bottom: 3px;
	font-family: "Helvetica Neue",Helvetica,Arial,Verdana,sans-serif;
	margin-top: 20px;
}
label.error {
	display: block;
	clear: both;
	margin-left: 310px;
}

.reg-form {
	margin-top: 15px;
	margin-left: 15px;
	position: relative;
	clear: both;
}
.message{
	font-size : 16px;
	font-weight : bold;
	margin-bottom: 10px;
	color : #FC0A0A;
}
-->
</style>
<div class="content-box"><!-- Start Content Box -->	
	<div class="content-box-header">
		<h3>Thay đổi mật khẩu</h3>
		<div class="clear"></div>
		
	</div> <!-- End content-box-header -->
	
	<?php echo $this->Form->create('User', array('id' => 'UserChangePasswordForm', 'inputDefaults' => array(
																						'label' => false,
																						'div' => false,
																						# define error defaults for the form
																						'error' => array(
																							'wrap' => 'span',
																							'class' => 'my-error-class'
																							)
																						)
			) ) ; ?>
	<div class="content-box-content">
		<div class="tab-content default-tab" id="tab1">		
			<!-- Edit User Form -->
			 	
			<div class="reg-form">
				<label class="reg-label">Mật khẩu cũ&nbsp;<span style="color:red">*</span></label> 
				<?php echo $form->input('password', array('id' => 'pass_old', 'label' => false, 'div' => false, 'value'=> "", 'type' => 'password', 'class' => 'required pass reg-input'));?>
			</div>	
			<div class="reg-form">
				<label class="reg-label">Mật khẩu mới&nbsp;<span style="color:red">*</span></label> 
				<?php echo $form->input('password_new', array('id' => 'pass', 'label' => false, 'div' => false, 'value'=> "", 'type' => 'password', 'class' => 'required pass reg-input'));?>
			</div>	
			<div class="reg-form">
				<label class="reg-label">Lặp lại mật khẩu&nbsp;<span style="color:red">*</span></label> 
				<?php echo $form->input('password_new_confirm', array('id' => 'pass_confirm', 'label' => false, 'div' => false, 'value'=>'', 'type' => 'password', 'class' => 'required reg-input'));?>
			</div>				
			<div class="reg-form" style="clear: both;">
				<input class="btn_orange" name="submit" value="Thay đổi" type="submit" onclick ="return check_pass_confirm()"> 
			</div>		
												
			<!-- End Edit User Form -->	
			<div class="clear"></div>		
			
		</div>
		<!-- End #tab1 -->

	</div> <!-- End content-box-content -->
	<?php echo $this->Form->End();?>
</div> <!-- End .content-box -->

 <script>
 $(document).ready(function (){
	$('#UserChangePasswordForm').validate();		

	jQuery.validator.addMethod("pass", function(value, element) { 
		if (value.length < 6) return false;
		else return true;		
	}, "Mật khẩu tối thiểu là 6 ký tự.");
 });
 
 function check_pass_confirm(){
	var ok=true;
	if ($('#pass').val() != $('#pass_confirm').val()){
		alert('Mật khẩu không khớp !');
		ok=false;
	}
	return ok;
}
 </script>